package com.cf.consumer;

import com.cf.log.DcServiceFallback;
import com.cf.log.TcServiceFallback;
import com.spring4all.swagger.EnableSwagger2Doc;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * boot-cloud-ConsumerApp
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/7/20 上午 11:58
 */
@EnableSwagger2Doc
@EnableFeignClients("com.cf")
@EnableDiscoveryClient
@EnableCircuitBreaker
@SpringBootApplication
public class ConsumerApp {

    @Bean
    public DcServiceFallback dcServiceFallback() {
        return new DcServiceFallback();
    }

    @Bean
    public TcServiceFallback TcServiceFallback() { return new TcServiceFallback(); }


    public static void main(String[] args) {
        new SpringApplicationBuilder(ConsumerApp.class).web(true).run(args);
    }

}